<div style="background-color: #eee">
<aside>
    <header><?php echo __('contact list').': '.count($contacts) ?></header>
    <div id="mini_contact_list" style="max-height: 329px; overflow: hidden">
    <ul class="list">
        <?php if(count($contacts)): ?>
        <?php foreach($contacts as $contact):?>   
        <li>
            <div class="list_main_container ">
                <img src="<?php echo $contact->photo ?>" alt="<?php echo $contact->name.' '.$contact->surname ?>"/>
                <div class="list_user_link"><a href="/desktop/<?php echo $contact->url ?>" class="desktop_link" title="<?php echo __('show desktop')?>"></a><a href="/profile/<?php echo $contact->url ?>" class="profile_link" title="<?php echo __('show profile')?>"></a></div>
                <div class="user_info">
                    <p class="mini_name ellipsis_character"><?php echo $contact->name.' '.$contact->surname ?></p>
                    <p class="mini_info ellipsis_word"><?php echo $contact->description ?></p>
                </div>
            </div>
        </li>
         
        <?php endforeach ?>       
        <?php else: ?>
            <li>
                <div class="list_main_container">
                    <div class="list_standard_entre" style="text-align: center; float: none"><?php echo __('no contacts to show') ?></div>                   
                </div>
            </li>
        <?php endif ?>     
    </ul>
    </div>
    <?php if ($mutual_friends and count($mutual_friends)): ?>
    <header><?php echo __('mutual contacts').': '.count($mutual_friends) ?></header>
    <ul class="list" id="mutual_contact_list" style="max-height: 141px; overflow: hidden">
    <?php foreach($mutual_friends as $mutual_friend): ?>
        <li>
            <div class="list_main_container ">
                <img src="<?php echo $mutual_friend->photo->path(false,'mini_square');?>" alt="<?php echo $mutual_friend->name.' '.$mutual_friend->surname ?>" />
                <div class="list_user_link"><a href="/desktop/<?php echo $mutual_friend->url ?>" class="desktop_link" title="<?php echo __('show desktop')?>"></a><a href="/profile/<?php echo $mutual_friend->url ?>" class="profile_link" title="<?php echo __('show profile')?>"></a></div>
                <div class="user_info">
                    <p class="mini_name ellipsis_character"><?php echo $mutual_friend->name.' '.$mutual_friend->surname ?></p>
                    <p class="mini_info ellipsis_word"><?php echo $mutual_friend->description ?></p>
                </div>
            </div>
        </li>
    <?php endforeach ?>
    </ul>
    <?php endif ?>
         
                
</aside>
<section id="profile">
   
    <div style="min-height: 450px;">
        <header></header>
        <section id="profile_main_info">
            <div style="float: left;">
                <img src="<?php echo $profile->photo->path(true,'square'); ?>" class="profile_image" alt="<?php echo $profile->name.' '.$profile->surname ?>"/>
            </div>
            <div class="right_side">
		<h1><?php echo $profile->name.' '.$profile->surname ?></h1>
	        <h3><?php echo $profile->description ?></h3>
						
		<dl style="padding-left: 0px">
                    <dt><?php echo __('Locality') ?>:</dt>
                    <dd><?php echo $profile->address ?>, <?php echo __($profile->country->name) ?></dd>
		</dl>
		<dl style="padding-left: 0px">
                    <dt><?php echo __('Fields') ?>:</dt>
                    <dd><ul><?php foreach($fields as $field) {  echo  '<li>'.__($field->name).'</li> '; } ?></ul></dd>
		</dl>	
            </div>
             <div style="clear:both"></div>
	</section>
        <section id="profile_more_info">
            <?php if (count($experiences)): ?>
            <section>
                    <header><figure class="app_icon icon_experience"></figure><?php echo __('Experience') ?></header>
                    <?php foreach($experiences as $experience): ?>
                    <div class="profile_info_container">
                            <dl>
                                    <dt><?php echo __('Employer') ?>:</dt>
                                    <dd><strong><?php echo $experience->employer ?></strong> (<?php echo __('from').' '.substr($experience->date_start,0,-12).' '.__('to').' '; echo $experience->date_end ? substr($experience->date_end,0,-12) : __('present')  ?>)</dd>
                            </dl>
                            <dl>
                                    <dt><?php echo __('Position') ?>:</dt>
                                    <dd><?php echo $experience->position ?></dd>
                            </dl>
                            <?php if ($experience->responsibilities): ?>
                            <dl>
                                    <dt><?php echo __('Responsibilities') ?>:</dt>
                                    <dd><?php echo Text::auto_p($experience->responsibilities) ?></dd>
                            </dl>
                            <?php endif ?>
                    </div>
                    <?php endforeach ?>			
            </section>
            <?php endif ?>
            <?php if (count($educations)): ?>
            <section>                                           
                    <header><figure class="app_icon icon_education"></figure><?php echo __('Education') ?></header>
                    <?php foreach($educations as $education): ?>
                    <div class="profile_info_container">
                            <dl>
                                    <dt><?php echo __('School name') ?>:</dt>
                                    <dd><strong><?php echo $education->school ?></strong> (<?php echo __('from').' '.substr($education->date_start,0,-12).' '.__('to').' '; echo $education->date_end ? substr($education->date_end,0,-12) : __('present')  ?>)</dd>
                            </dl>
                            <dl>
                                    <dt><?php echo __('Faculty') ?>:</dt>
                                    <dd><?php echo $education->faculty ?></dd>
                            </dl>
                            <dl>
                                    <dt><?php echo __('Degree') ?>:</dt>
                                    <dd><?php echo $education->degree ?></dd>
                            </dl>
                    </div>
                    <?php endforeach ?>
            </section>
            <?php endif ?>
            <?php if ($additional->achievements
                      OR $additional->courses
                      OR $additional->organizations
                      OR $additional->languages
                      OR $additional->interests): ?>
            <section>
                <header><figure class="app_icon icon_additional"></figure><?php echo __('Additional') ?></header>
                    <?php if ($additional->achievements): ?>
                    <div class="profile_info_container">
                            <dl>
                                    <dt><?php echo __('Achievements') ?>:</dt>
                                    <dd><?php echo Text::auto_p($additional->achievements) ?></dd>
                            </dl>
                    </div>
                    <?php endif ?>
                    <?php if ($additional->courses): ?>
                    <div class="profile_info_container">
                            <dl>
                                    <dt><?php echo __('Completed courses') ?>:</dt>
                                    <dd><?php echo Text::auto_p($additional->courses) ?></dd>
                            </dl>
                    </div>
                     <?php endif ?>
                    <?php if ($additional->organizations): ?>
                    <div class="profile_info_container">
                            <dl>
                                    <dt><?php echo __('Organizations') ?>:</dt>
                                    <dd><?php echo Text::auto_p($additional->organizations) ?></dd>
                            </dl>
                    </div>
                    <?php endif ?>
                    <?php if ($additional->languages): ?>
                    <div class="profile_info_container">
                            <dl>
                                    <dt><?php echo __('Languages') ?>:</dt>
                                    <dd><?php echo Text::auto_p($additional->languages) ?></dd>
                            </dl>
                    </div>
                     <?php endif ?>
                    <?php if ($additional->interests): ?>
                    <div class="profile_info_container">
                            <dl>
                                    <dt><?php echo __('Interests') ?>:</dt>
                                    <dd><?php echo Text::auto_p($additional->interests) ?></dd>
                            </dl>
                    </div>
                    <?php endif ?>

            </section>
            <?php endif ?>
        </section>
				</div>
				
			</section>
    <div style="clear:left"></div>
</div>
<?php echo $profile_navigation ?>
<script type="text/javascript">
    
   head.ready(function() {
       site.init('profile-view');
   });
        
</script>


